package com.xunai.saas.example.service.impl;

import com.xunai.saas.example.model.enums.FaceEnum;
import com.xunai.saas.example.model.param.FaceAnalysisParam;
import com.xunai.saas.example.model.param.FaceAnswerAnalysisParam;
import com.xunai.saas.example.service.FaceService;
import com.xunai.saas.example.utils.HttpClientUtils;
import org.springframework.stereotype.Service;

@Service
public class FaceServiceImpl extends HttpClientUtils implements FaceService {

    @Override
    public String faceAnalysis(FaceAnalysisParam faceAnalysisParam) {
        return sendPost(FaceEnum.faceAnalysis.getUrl(), faceAnalysisParam);
    }

    @Override
    public String faceAnswerAnalysis(FaceAnswerAnalysisParam faceAnswerAnalysisParam) {
        return sendPost(FaceEnum.faceAnswerAnalysis.getUrl(), faceAnswerAnalysisParam);
    }

    @Override
    public String faceResultQuery(String faceId) {
        String url = String.format(FaceEnum.faceResultQuery.getUrl(), faceId);
        return sendGet(url);
    }
}
